<script src="<?php echo base_url();?>public/javascript/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="<?php echo base_url();?>public/javascript/jquery.imgareaselect.min.js" type="text/javascript"></script>
    
    <?php if($data_output['large_photo_exists'] && $data_output['thumb_photo_exists'] == NULL):?>
    <script src="<?php echo base_url();?>public/javascript/jquery.imgpreview.js" type="text/javascript"></script>
    <script type="text/javascript">
    // <![CDATA[
        var thumb_width    = <?php echo $data_output['thumb_width'] ;?> ;
        var thumb_height   = <?php echo $data_output['thumb_height'] ;?> ;
        var image_width    = <?php echo $data_output['img']['image_width'] ;?> ;
        var image_height   = <?php echo $data_output['img']['image_height'] ;?> ;
    // ]]>
    </script>
    <?php endif ;?>
<div class="page">
    <div class="container">
        <div class="span10 offset1" style="margin-top:20px" id="wrap">
<!-- <h4>Ubah Avatar</h4>
<form name="go" enctype="multipart/form-data" method="POST" action="<?php echo site_url().'/profil/changeAvatar/';?>">  
              
              <div class="row">
              <div class="span2">Nama</div>
              <div class="span4"><strong><?php echo $output['name'];?></strong></div>
              <input type="hidden" name="name" value="<?php echo $output['name'];?>"/>
              </div>
              <div class="row">
              <div class="span2">Password</div>   
              <div class="span4"><input class="span3" type="password" name="password" value="" placeholder="password"/></div>
              </div>
              <div class="row">
              <div class="span2">Avatar</div>
              <div class="span4"><input type="file" name="avatar"/></div>
              <input type="hidden" name="userId" value="<?php echo $output['id'];?>"/>
              </div>
              <?php echo $output['id'];?>
              <div class="row">
              <div class="span6">
              <input type="submit" class="btn btn-primary btn-large span3 offset6" value="UBAH AVATAR"/>
          </div></div>
          </form>
    <br/> -->
    <h4>Upload Avatar</h4>
<?php if($data_output['error']) :?>
    <ul><li><strong>Error!</strong></li><li><?php echo $data_output['error'] ;?></li></ul>
<?php endif ;?>

<?php if($data_output['large_photo_exists'] && $data_output['thumb_photo_exists']) :?>
  <?php echo $data_output['large_photo_exists']."&nbsp;".$data_output['thumb_photo_exists']; ?>
  <!-- <p><a href="<?php echo $_SERVER["PHP_SELF"];?>">Upload another</a></p> -->
  <p><a href="<?php echo site_url(); ?>profil/detail/<?php echo $this->session->userdata('user_id'); ?>" class="btn btn-warning">Kembali ke profil</a></p>

<?php elseif($data_output['large_photo_exists'] && $data_output['thumb_photo_exists'] == NULL) :?>

<h2>Create Thumbnail</h2>
<div align="center">
        <img src="<?php echo base_url() . $data_output['upload_path'].$data_output['img']['file_name'];?>" style="float: left; margin-right: 10px;" id="thumbnail" alt="Create Thumbnail" />
        <!--<div style="border:1px #e5e5e5 solid; float:left; position:relative; overflow:hidden; width:<?php echo $data_output['thumb_width'];?>px; height:<?php echo $data_output['thumb_height'];?>px;">
                <img src="<?php echo base_url() . $data_output['upload_path'].$data_output['img']['file_name'];?>" style="position: relative;" alt="Thumbnail Preview" />
        </div> -->
        <br style="clear:both;"/>
        <form name="thumbnail" action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
                <input type="hidden" name="x1" value="" id="x1" />
                <input type="hidden" name="y1" value="" id="y1" />
                <input type="hidden" name="x2" value="" id="x2" />
                <input type="hidden" name="y2" value="" id="y2" />
                <input type="hidden" name="file_name" value="<?php echo $data_output['img']['file_name'] ;?>" />
                <input type="submit" name="upload_thumbnail" value="Save Thumbnail" id="save_thumb" />
        </form>
</div>

<hr />
<?php   else : ?>

<!-- <h2>Upload Photo</h2> -->
<form name="photo" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
Photo <input type="file" name="image" size="30" /> <input type="submit" name="upload" value="Upload" />
</form>
<?php   endif ?>
</div>
</div>
</div>
